\(\int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\) [154]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 27 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {i}{3 a d (a+i a \tan (c+d x))^3} \]

[Out]

1/3*I/a/d/(a+I*a*tan(d*x+c))^3

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 32} \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {i}{3 a d (a+i a \tan (c+d x))^3} \]

[In]

Int[Sec[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

(I/3)/(a*d*(a + I*a*Tan[c + d*x])^3)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \text {Subst}\left (\int \frac {1}{(a+x)^4} \, dx,x,i a \tan (c+d x)\right )}{a d} \\ & = \frac {i}{3 a d (a+i a \tan (c+d x))^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.81 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {1}{3 a^4 d (-i+\tan (c+d x))^3} \]

[In]

Integrate[Sec[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

-1/3*1/(a^4*d*(-I + Tan[c + d*x])^3)

Maple [A] (verified)

Time = 0.48 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89

method result size
derivativedivides \(\frac {i}{3 a d \left (a +i a \tan \left (d x +c \right )\right )^{3}}\) \(24\)
default \(\frac {i}{3 a d \left (a +i a \tan \left (d x +c \right )\right )^{3}}\) \(24\)
risch \(\frac {i {\mathrm e}^{-2 i \left (d x +c \right )}}{8 a^{4} d}+\frac {i {\mathrm e}^{-4 i \left (d x +c \right )}}{8 a^{4} d}+\frac {i {\mathrm e}^{-6 i \left (d x +c \right )}}{24 a^{4} d}\) \(56\)

[In]

int(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/3*I/a/d/(a+I*a*tan(d*x+c))^3

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.52 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {{\left (3 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 3 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{24 \, a^{4} d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

1/24*(3*I*e^(4*I*d*x + 4*I*c) + 3*I*e^(2*I*d*x + 2*I*c) + I)*e^(-6*I*d*x - 6*I*c)/(a^4*d)

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 272 vs. \(2 (19) = 38\).

Time = 1.20 (sec) , antiderivative size = 272, normalized size of antiderivative = 10.07 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\begin {cases} - \frac {i \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{24 a^{4} d \tan ^{4}{\left (c + d x \right )} - 96 i a^{4} d \tan ^{3}{\left (c + d x \right )} - 144 a^{4} d \tan ^{2}{\left (c + d x \right )} + 96 i a^{4} d \tan {\left (c + d x \right )} + 24 a^{4} d} - \frac {4 \tan {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{24 a^{4} d \tan ^{4}{\left (c + d x \right )} - 96 i a^{4} d \tan ^{3}{\left (c + d x \right )} - 144 a^{4} d \tan ^{2}{\left (c + d x \right )} + 96 i a^{4} d \tan {\left (c + d x \right )} + 24 a^{4} d} + \frac {7 i \sec ^{2}{\left (c + d x \right )}}{24 a^{4} d \tan ^{4}{\left (c + d x \right )} - 96 i a^{4} d \tan ^{3}{\left (c + d x \right )} - 144 a^{4} d \tan ^{2}{\left (c + d x \right )} + 96 i a^{4} d \tan {\left (c + d x \right )} + 24 a^{4} d} & \text {for}\: d \neq 0 \\\frac {x \sec ^{2}{\left (c \right )}}{\left (i a \tan {\left (c \right )} + a\right )^{4}} & \text {otherwise} \end {cases} \]

[In]

integrate(sec(d*x+c)**2/(a+I*a*tan(d*x+c))**4,x)

[Out]

Piecewise((-I*tan(c + d*x)**2*sec(c + d*x)**2/(24*a**4*d*tan(c + d*x)**4 - 96*I*a**4*d*tan(c + d*x)**3 - 144*a
**4*d*tan(c + d*x)**2 + 96*I*a**4*d*tan(c + d*x) + 24*a**4*d) - 4*tan(c + d*x)*sec(c + d*x)**2/(24*a**4*d*tan(
c + d*x)**4 - 96*I*a**4*d*tan(c + d*x)**3 - 144*a**4*d*tan(c + d*x)**2 + 96*I*a**4*d*tan(c + d*x) + 24*a**4*d)
 + 7*I*sec(c + d*x)**2/(24*a**4*d*tan(c + d*x)**4 - 96*I*a**4*d*tan(c + d*x)**3 - 144*a**4*d*tan(c + d*x)**2 +
 96*I*a**4*d*tan(c + d*x) + 24*a**4*d), Ne(d, 0)), (x*sec(c)**2/(I*a*tan(c) + a)**4, True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.78 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {i}{3 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{3} a d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

1/3*I/((I*a*tan(d*x + c) + a)^3*a*d)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 85 vs. \(2 (21) = 42\).

Time = 0.63 (sec) , antiderivative size = 85, normalized size of antiderivative = 3.15 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {2 \, {\left (3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 10 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{3 \, a^{4} d {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{6}} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

-2/3*(3*tan(1/2*d*x + 1/2*c)^5 - 6*I*tan(1/2*d*x + 1/2*c)^4 - 10*tan(1/2*d*x + 1/2*c)^3 + 6*I*tan(1/2*d*x + 1/
2*c)^2 + 3*tan(1/2*d*x + 1/2*c))/(a^4*d*(tan(1/2*d*x + 1/2*c) - I)^6)

Mupad [B] (verification not implemented)

Time = 3.74 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.70 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {1}{3\,a^4\,d\,{\left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}^3} \]

[In]

int(1/(cos(c + d*x)^2*(a + a*tan(c + d*x)*1i)^4),x)

[Out]

-1/(3*a^4*d*(tan(c + d*x) - 1i)^3)